package control;

import java.awt.CardLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class MainMenuManager implements ActionListener, Manager{
	
	private Control control;
	public MainMenuManager(Control c){
		control = c;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		
		if (e.getActionCommand().equals("New Game")){
			control.newGame();
			
		}else if (e.getActionCommand().equals("Options")){
			
	//		CardLayout cl = (CardLayout)(control.gui.getMenus().getLayout());
	//        cl.show(control.gui.getMenus(), "OptionsMenu");
			
			control.gui.showMenu("OptionsMenu");
//			control.gui.getMainMenu().close();
//			control.gui.changeMenu(control.gui.getOptionsMenu());
	        
		}else if (e.getActionCommand().equals("Highscores")){
			control.gui.showMenu("HighscoreMenu");
			System.out.println("Highscores");
			
		}else if (e.getActionCommand().equals("Help")){
			System.out.println("Help");
			
		}else if (e.getActionCommand().equals("Exit")){
			System.exit(0);
		}
	}
}
